package com.dg11185.nearshop.net.request;

import com.dg11185.libs.network.http.client.HttpRequest;
import com.dg11185.libs.utils.MD5.MD5Utils;
import com.dg11185.nearshop.app.Constants;
import com.dg11185.nearshop.net.response.GetMerchantListResponse;
import com.dg11185.nearshop.net.response.MyFavorListResponse;

public class MyFavorListRequest extends HttpRequest<MyFavorListResponse>{

	public MyFavorListRequest(String userId) {
		super(Constants.ADDRESS, Constants.myFavorList);
		// TODO Auto-generated constructor stub
		addParam("userId", userId);
		addParam("chshToken", Constants.TOKEN);
		
	}
	
	  /**
     * <可选参数>
     * <param name="type">类型</param>
     *<param name="pageNumber">当前页码</param>
     *<param name="pageSize">每页数量</param>
     *<param name="orderName">排序字段</param>
     *<param name="orderType">0.升序，1.降序</param>
     * <param name="orderType">0.升序，1.降序</param>
     * </可选参数>
     */
	
    public MyFavorListRequest add(String key, String value){
        addParam(key, value);
        return this;
    }
	
	public MyFavorListRequest encryption(){
        addParam("chshSign", MD5Utils.getMD5Str(getParams(), Constants.MD5_key));
        return this;
    }

	@Override
	protected MyFavorListResponse parseJson(String response) throws Exception {
		// TODO Auto-generated method stub
		MyFavorListResponse r = new MyFavorListResponse();
        r.parseJson(response);
        return r;
	}

}
